package com.xm_jd.model.dao;

import java.util.List;

import com.xm_jd.model.entitys.IndexVO;
import com.xm_jd.utils.BaseDao;

public class Index1Dao {
	BaseDao<IndexVO> dao = new BaseDao<>(IndexVO.class);
	
	public List<IndexVO> getselectsp(int dd_id){
		String sql = "SELECT *  FROM  tb_xd INNER JOIN tb_dd ON tb_dd.dd_id=tb_xd.xd_dd_id  INNER JOIN tb_user ON tb_dd.dd_user_id=tb_user.user_id INNER JOIN tb_shoop ON tb_shoop.shoop_Id=tb_xd.xd_shoop_id INNER JOIN tb_picture ON tb_picture.picture_shoop_Id=tb_shoop.shoop_Id  WHERE dd_id=? and picture_Zcg='1' AND dd_ztai!='已删除' ORDER  BY dd_time desc";
		return dao.selectAll(sql, new Object[]{dd_id});
	}
	
	/**
	 * 根据用户编号获取订单编号
	 * @return
	 */
	public List<IndexVO> getOrderId(int uid){
		String sql = "select * from tb_dd where dd_user_id=? order by dd_time desc";
		return dao.selectAll(sql, new Object[]{uid});
	}
	
	public int updatezt(String zt){
		String sql = "UPDATE tb_dd SET dd_ztai='已删除' WHERE dd_id=?;";
		return dao.executeUpdate(sql, new Object[]{zt});
	}
}
